﻿#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int numbers = 0;

bool is_prime(int num)
{
    if (num <= 1)
    {
        return false;
    }
    for (int i = 2; i <= sqrt(num)i++)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}
}

int main()
{
    string words[] = ("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine");
    string input;
    getline(cin, input);
    int num = 0;

    stringstream ss(input);
    string word;
    int wordcount = 0;
    while (ss >> word) {
        wordcount++;
    }

    for (int i = 0; i < wordcount; i++)
    {
        if (input == "zero") {
            numbers = 0;
        }
        if (input == "one") {
            numbers = 1;
        }
        if (input == "two") {
            numbers = 2;
        }
        if (input == "three") {
            numbers = 3;
        }
        if (input == "four") {
            numbers = 4;
        }
        if (input == "five") {
            numbers = 5;
        }
        if (input == "six") {
            numbers = 6;
        }
        if (input == "seven") {
            numbers = 7;
        }
        if (input == "eight") {
            numbers = 8;
        }
        if (input == "nine") {
            numbers = 9;
        }
        cout << numbers << endl;
    }
    for (int i = 0; i < 3; i++)
    {
        int word_index = -1;
        for (int j = 0; j < 10; j++)
        {
            if (words[j] == input.substr(i * 5, 5))
            {
                word_index = j;
                break;
            }
        }
        if (word_index == -1)
        {
            cout << "Wrong input" << endl;
            return 0;
        }
    }